package org.infodavid.common.impl.commands;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import org.infodavid.common.commands.IBasicCommand;

/**
 * The Class BasicCommandImpl.
 */
public class BasicCommandImpl implements IBasicCommand {

  /** The Constant serialVersionUID. */
  private static final long serialVersionUID = 4464754599368905958L;

  /** The properties. */
  private final Map<String,Serializable> properties = new HashMap<String,Serializable>();

  /** The key of the requesting user. */
  private Long requestingUserKey = null;

  /**
   * See super class or interface. (non-Javadoc)
   * @see org.infodavid.common.commands.IBasicCommand#getProperties()
   */
  public Map<String,Serializable> getProperties() {
    return properties;
  }

  /**
   * See super class or interface. (non-Javadoc)
   * @see org.infodavid.common.commands.IBasicCommand#getRequestingUserKey()
   */
  public Long getRequestingUserKey() {
    return requestingUserKey;
  }

  /**
   * See super class or interface. (non-Javadoc)
   * @see org.infodavid.common.commands.IBasicCommand#setRequestingUserKey(java.lang.Long)
   */
  public void setRequestingUserKey(final Long value) {
    requestingUserKey = value;
  }

  /**
   * See super class or interface. (non-Javadoc)
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {
    final StringBuilder builder = new StringBuilder();

    builder.append(super.toString());
    builder.append(" [properties=");
    builder.append(properties);
    builder.append(", requestingUserKey=");
    builder.append(requestingUserKey);
    builder.append("]");

    return builder.toString();
  }
}
